#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time: 2022/9/17 1:03
# @Author: 张涛
# @Email: xxx@gmail.com
# @File：chanpin_bj_page.py

"""
商机编辑页面
"""

from selenium.webdriver.common.by import By
from pages.base_page import BasePage


class Edit(BasePage):
    bjkftd_locator = (By.ID,'development_team') #编辑开发团队
    bjcpmc_locator = (By.ID,'name')  #编辑产品名称
    bjbc_locator = (By.CSS_SELECTOR,'#form1 > table > tfoot > tr > td > input.btn.btn-primary') #编辑保存

    def bjkftd_element(self,bjkftd_a):
        '''编辑开发团队'''
        self.driver.find_element(*self.bjkftd_locator).clear()
        self.driver.find_element(*self.bjkftd_locator).send_keys(bjkftd_a)

    def bjcpmc_element(self,bjcpmc_a):
        '''编辑产品名称'''
        self.driver.find_element(*self.bjcpmc_locator).clear()
        self.driver.switch_to.alert.accept()  # 提示弹框选择确定
        self.driver.find_element(*self.bjcpmc_locator).send_keys(bjcpmc_a)

    def bjbc_element(self):
        '''点击保存'''
        self.driver.find_element(*self.bjbc_locator).click()


